package cn.cxj.basic.interceptor;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

//@Configuration
public class MyWebMvcConfigurer implements WebMvcConfigurer {

    @Autowired
    private LoginInterceptor loginInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(loginInterceptor)
                .addPathPatterns("/**")
                .excludePathPatterns(
                        // 登陆
                        "/login/**",
                        // 手机号注册
                        "/user/phone/register",
                        // 邮箱注册
                        "/user/email/register",
                        // 店铺入驻
                        "/shop/settlement",
                        // 分布式文件管理系统,保存店招和头像
                        "/fastDfs/**",
                        // 发送验证码
                        "/verifycode/**",
                        // 店铺注册
                        "/shopRegister",
                        // 员工修改状态
                        "/employee/updateStateById",
                        // 用户修改状态
                        "/user/updateStateById",
                        "/notifyUrl",
                        "/returnUrl"
                );


    }
}
